-- @owner: zou_jialiang050
-- @date: 2024/4/2
-- @testpoint: excluded作为函数名

--step1:建表;expect:成功
drop table if exists t_excluded_0007;
create table t_excluded_0007(cid int);

--step2:excluded作为函数名;expect:成功
drop function if exists excluded;
create function excluded(card_id int) returns char(50) as
$$
declare num int := 0;
begin
while num<=card_id loop
insert into t_excluded_0007 values(num);
num := num+1;
end loop;
return card_id;
end;
$$ language plpgsql;
/

select excluded(3);
select * from t_excluded_0007;

--step3:清理环境;expect:成功
drop function if exists excluded;
drop table if exists t_excluded_0007;